package cc.rengu.igas.momp.common.util;

import cc.rengu.igas.momp.common.entity.*;
import cc.rengu.igas.momp.common.enums.RespCodeEnum;
import cc.rengu.igas.momp.common.enums.TableNameEnum;
import cc.rengu.igas.momp.common.model.bean.*;
import cc.rengu.oltp.service.model.BizException;
import cc.rengu.utility.log.RgLogger;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * 临时表JSON操作工具类
 *
 * @author Jinan Liu
 * @date 2020/5/22 15:12
 */

public class JsonOperation {

    /**
     * 使用卡券类营销活动信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcCouponInfo 卡券类营销活动信息表
     * @param rgLogger       平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/25 21:51
     */
    public static String packCpMcInfoTmpBizData1(TMMcCouponInfo tmMcCouponInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();
            jsonObject.put("inst_id", tmMcCouponInfo.getInstId());
            jsonObject.put("mc_no", tmMcCouponInfo.getMcNo());
            jsonObject.put("mc_name", tmMcCouponInfo.getMcName());
            jsonObject.put("mc_type", tmMcCouponInfo.getMcType());
            jsonObject.put("mc_status", tmMcCouponInfo.getMcStatus());
            jsonObject.put("mc_start_date", tmMcCouponInfo.getMcStartDate());
            jsonObject.put("mc_end_date", tmMcCouponInfo.getMcEndDate());
            jsonObject.put("mc_actual_end_date", tmMcCouponInfo.getMcActualEndDate());
            jsonObject.put("mc_time_flag", tmMcCouponInfo.getMcTimeFlag());
            jsonObject.put("sponsor", tmMcCouponInfo.getSponsor());
            jsonObject.put("restriction", tmMcCouponInfo.getRestriction());
            jsonObject.put("client_range", tmMcCouponInfo.getClientRange());
            jsonObject.put("merchant_range", tmMcCouponInfo.getMerchantRange());
            jsonObject.put("new_mchnt_flag", tmMcCouponInfo.getNewMchntFlag());
            jsonObject.put("amt_limit_floor", tmMcCouponInfo.getAmtLimitFloor());
            jsonObject.put("amt_limit_celling", tmMcCouponInfo.getAmtLimitCelling());
            jsonObject.put("budget_recharge_method", tmMcCouponInfo.getBudgetRechargeMethod());
            jsonObject.put("budget", tmMcCouponInfo.getBudget());
            jsonObject.put("bank_budget", tmMcCouponInfo.getBankBudget());
            jsonObject.put("expect_mchnt_qty", tmMcCouponInfo.getExpectMchntQty());
            jsonObject.put("bank_budget_ratio", tmMcCouponInfo.getBankBudgetRatio());
            jsonObject.put("purchase_flag", tmMcCouponInfo.getPurchaseFlag());
            jsonObject.put("available_date", tmMcCouponInfo.getAvailableDate());
            jsonObject.put("coupon_date_flag", tmMcCouponInfo.getCouponDateFlag());
            jsonObject.put("coupon_start_date", tmMcCouponInfo.getCouponStartDate());
            jsonObject.put("coupon_end_date", tmMcCouponInfo.getCouponEndDate());
            jsonObject.put("coupon_period", tmMcCouponInfo.getCouponPeriod());
            jsonObject.put("coupon_inventory", tmMcCouponInfo.getCouponInventory());
            jsonObject.put("coupon_rest", tmMcCouponInfo.getCouponInventory());
            jsonObject.put("coupon_claimed", tmMcCouponInfo.getCouponClaimed());
            jsonObject.put("coupon_redeemed", tmMcCouponInfo.getCouponRedeemed());
            jsonObject.put("crt_org_id", tmMcCouponInfo.getCrtOrgId());
            jsonObject.put("claim_channel_id", tmMcCouponInfo.getClaimChannelId());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用减免类营销活动规则信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcCouponRuleInfo 卡券类营销活动规则信息表
     * @param rgLogger           平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 22:39
     */
    public static String packCpMcRuleInfoTmpBizData1(TMMcCouponRuleInfo tmMcCouponRuleInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("inst_id", tmMcCouponRuleInfo.getInstId());
            jsonObject.put("mc_no", tmMcCouponRuleInfo.getMcNo());
            jsonObject.put("rule_index", tmMcCouponRuleInfo.getRuleIndex());
            jsonObject.put("criteria", tmMcCouponRuleInfo.getCriteria());
            jsonObject.put("denomination", tmMcCouponRuleInfo.getDenomination());
            jsonObject.put("quantity", tmMcCouponRuleInfo.getQuantity());
            jsonObject.put("day_redeem_limit", tmMcCouponRuleInfo.getDayRedeemLimit());
            jsonObject.put("purchase_flag", tmMcCouponRuleInfo.getPurchaseFlag());
            jsonObject.put("purchase_amt", tmMcCouponRuleInfo.getPurchaseAmt());
            jsonObject.put("batch_task_status", tmMcCouponRuleInfo.getBatchTaskStatus());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用手续费减免类营销活动信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcMchntFeeDiscountInfo 商户手续费减免类营销活动信息表
     * @param rgLogger                 平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/25 21:51
     */
    public static String packMfdMcInfoTmpBizData1(TMMcMchntFeeDiscountInfo tmMcMchntFeeDiscountInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();
            jsonObject.put("inst_id", tmMcMchntFeeDiscountInfo.getInstId());
            jsonObject.put("mc_no", tmMcMchntFeeDiscountInfo.getMcNo());
            jsonObject.put("mc_name", tmMcMchntFeeDiscountInfo.getMcName());
            jsonObject.put("mc_type", tmMcMchntFeeDiscountInfo.getMcType());
            jsonObject.put("mc_status", tmMcMchntFeeDiscountInfo.getMcStatus());
            jsonObject.put("mc_start_date", tmMcMchntFeeDiscountInfo.getMcStartDate());
            jsonObject.put("mc_end_date", tmMcMchntFeeDiscountInfo.getMcEndDate());
            jsonObject.put("mc_actual_end_date", tmMcMchntFeeDiscountInfo.getMcActualEndDate());
            jsonObject.put("stock_mchnt_flag", tmMcMchntFeeDiscountInfo.getStockMchntFlag());
            jsonObject.put("stock_mchnt_type", tmMcMchntFeeDiscountInfo.getStockMchntType());
            jsonObject.put("effective_limit", tmMcMchntFeeDiscountInfo.getEffectiveLimit());
            jsonObject.put("new_mchnt_flag", tmMcMchntFeeDiscountInfo.getNewMchntFlag());
            jsonObject.put("new_mchnt_period", tmMcMchntFeeDiscountInfo.getNewMchntPeriod());
            jsonObject.put("postpone_flag", tmMcMchntFeeDiscountInfo.getPostponeFlag());
            jsonObject.put("before_flag", tmMcMchntFeeDiscountInfo.getBeforeFlag());
            jsonObject.put("after_flag", tmMcMchntFeeDiscountInfo.getAfterFlag());
            jsonObject.put("termination_flag", tmMcMchntFeeDiscountInfo.getTerminationFlag());
            jsonObject.put("stat_period", tmMcMchntFeeDiscountInfo.getStatPeriod());
            jsonObject.put("quantity_limit", tmMcMchntFeeDiscountInfo.getQuantityLimit());
            jsonObject.put("amount_limit", tmMcMchntFeeDiscountInfo.getAmountLimit());
            jsonObject.put("fee_limit", tmMcMchntFeeDiscountInfo.getFeeLimit());
            jsonObject.put("budget_recharge_method", tmMcMchntFeeDiscountInfo.getBudgetRechargeMethod());
            jsonObject.put("budget", tmMcMchntFeeDiscountInfo.getBudget());
            jsonObject.put("deposit_mon_num", tmMcMchntFeeDiscountInfo.getDepositMonNum());
            jsonObject.put("crt_org_id", tmMcMchntFeeDiscountInfo.getCrtOrgId());
            jsonObject.put("new_mchnt_amount_limit", tmMcMchntFeeDiscountInfo.getNewMchntAmountLimit());
            jsonObject.put("avySprtMrctTyp", tmMcMchntFeeDiscountInfo.getavySprtMrctTyp());
            jsonObject.put("newmrct_free_lmt_typ", tmMcMchntFeeDiscountInfo.getNewmrctFreeLmtTyp());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用减免类营销活动规则信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcMchntFeeDiscountRuleInfo 商户手续费减免类营销活动规则信息表
     * @param rgLogger                     平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 22:39
     */
    public static String packMfdMcRuleInfoTmpBizData1(TMMcMchntFeeDiscountRuleInfo tmMcMchntFeeDiscountRuleInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("inst_id", tmMcMchntFeeDiscountRuleInfo.getInstId());
            jsonObject.put("mc_no", tmMcMchntFeeDiscountRuleInfo.getMcNo());
            jsonObject.put("rule_index", tmMcMchntFeeDiscountRuleInfo.getRuleIndex());
            jsonObject.put("criteria_floor", tmMcMchntFeeDiscountRuleInfo.getCriteriaFloor());
            jsonObject.put("criteria_celling", tmMcMchntFeeDiscountRuleInfo.getCriteriaCelling());
            jsonObject.put("discount_period", tmMcMchntFeeDiscountRuleInfo.getDiscountPeriod());
            jsonObject.put("discount_type", tmMcMchntFeeDiscountRuleInfo.getDiscountType());
            jsonObject.put("discount", tmMcMchntFeeDiscountRuleInfo.getDiscount());
            jsonObject.put("cal_rule_no", tmMcMchntFeeDiscountRuleInfo.getCalRuleNo());
            jsonObject.put("discount_limit", tmMcMchntFeeDiscountRuleInfo.getDiscountLimit());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用减免类营销活动信息表实体类拼接临时表BizData1字段内容
     *
     * @param mcMoneyOffInfo 减免类营销活动信息表
     * @param rgLogger       平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/25 21:51
     */
    public static String packMoMcInfoTmpBizData1(TMMcMoneyOffInfo mcMoneyOffInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();
            jsonObject.put("inst_id", mcMoneyOffInfo.getInstId());
            jsonObject.put("mc_no", mcMoneyOffInfo.getMcNo());
            jsonObject.put("mc_name", mcMoneyOffInfo.getMcName());
            jsonObject.put("mc_type", mcMoneyOffInfo.getMcType());
            jsonObject.put("mc_status", mcMoneyOffInfo.getMcStatus());
            jsonObject.put("mc_start_date", mcMoneyOffInfo.getMcStartDate());
            jsonObject.put("mc_end_date", mcMoneyOffInfo.getMcEndDate());
            jsonObject.put("mc_actual_end_date", mcMoneyOffInfo.getMcActualEndDate());
            jsonObject.put("mc_time_flag", mcMoneyOffInfo.getMcTimeFlag());
            jsonObject.put("sponsor", mcMoneyOffInfo.getSponsor());
            jsonObject.put("restriction", mcMoneyOffInfo.getRestriction());
            jsonObject.put("client_range", mcMoneyOffInfo.getClientRange());
            jsonObject.put("merchant_range", mcMoneyOffInfo.getMerchantRange());
            jsonObject.put("new_mchnt_flag", mcMoneyOffInfo.getNewMchntFlag());
            jsonObject.put("amt_limit_floor", mcMoneyOffInfo.getAmtLimitFloor());
            jsonObject.put("amt_limit_celling", mcMoneyOffInfo.getAmtLimitCelling());
            jsonObject.put("budget_recharge_method", mcMoneyOffInfo.getBudgetRechargeMethod());
            jsonObject.put("budget", mcMoneyOffInfo.getBudget());
            jsonObject.put("bank_budget", mcMoneyOffInfo.getBankBudget());
            jsonObject.put("expect_mchnt_qty", mcMoneyOffInfo.getExpectMchntQty());
            jsonObject.put("bank_budget_ratio", mcMoneyOffInfo.getBankBudgetRatio());
            jsonObject.put("crt_org_id", mcMoneyOffInfo.getCrtOrgId());
            jsonObject.put("odcrd_dis_times", mcMoneyOffInfo.getOdcrdDisTimes());
            jsonObject.put("prk_busn_flg", mcMoneyOffInfo.getPrkBusnFlg());
            jsonObject.put("mc_lvl_cd", mcMoneyOffInfo.getMcLvlCd());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用减免类营销活动信息表实体类拼接临时表BizData1字段内容
     *
     * @param mcAgentProfitSharingInfo 减免类营销活动信息表
     * @param rgLogger                 平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/25 21:51
     */
    public static String packApsInfoTmpBizData1(TMMcAgentProfitSharingInfo mcAgentProfitSharingInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();
            jsonObject.put("inst_id", mcAgentProfitSharingInfo.getInstId());
            jsonObject.put("mc_no", mcAgentProfitSharingInfo.getMcNo());
            jsonObject.put("mc_name", mcAgentProfitSharingInfo.getMcName());
            jsonObject.put("mc_type", mcAgentProfitSharingInfo.getMcType());
            jsonObject.put("mc_status", mcAgentProfitSharingInfo.getMcStatus());
            jsonObject.put("mc_start_date", mcAgentProfitSharingInfo.getMcStartDate());
            jsonObject.put("mc_end_date", mcAgentProfitSharingInfo.getMcEndDate());
            jsonObject.put("mc_actual_end_date", mcAgentProfitSharingInfo.getMcActualEndDate());
            jsonObject.put("agent_mchnt_no", mcAgentProfitSharingInfo.getAgentMchntNo());
            jsonObject.put("org_id", mcAgentProfitSharingInfo.getOrgId());
            jsonObject.put("discount_transfer_mode", mcAgentProfitSharingInfo.getDiscountTransferMode());
            jsonObject.put("budget", mcAgentProfitSharingInfo.getBudget());
            jsonObject.put("criteria_flag", mcAgentProfitSharingInfo.getCriteriaFlag());
            jsonObject.put("criteria_limit", mcAgentProfitSharingInfo.getCriteriaLimit());
            jsonObject.put("stat_period", mcAgentProfitSharingInfo.getStatPeriod());
            jsonObject.put("criteria_amount", mcAgentProfitSharingInfo.getCriteriaAmount());
            jsonObject.put("criteria_quantity", mcAgentProfitSharingInfo.getCriteriaQuantity());
            jsonObject.put("cashback_period", mcAgentProfitSharingInfo.getCashbackPeriod());
            jsonObject.put("audit_status", mcAgentProfitSharingInfo.getAuditStatus());
            jsonObject.put("opr_id", mcAgentProfitSharingInfo.getOprId());
            jsonObject.put("create_time", mcAgentProfitSharingInfo.getCreateTime());
            jsonObject.put("crt_org_id", mcAgentProfitSharingInfo.getCrtOrgId());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用减免类营销活动规则信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcMoneyOffRuleInfo 减免类营销活动规则表
     * @param rgLogger             平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 22:39
     */
    public static String packMoMcRuleInfoTmpBizData1(TMMcMoneyOffRuleInfo tmMcMoneyOffRuleInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("inst_id", tmMcMoneyOffRuleInfo.getInstId());
            jsonObject.put("mc_no", tmMcMoneyOffRuleInfo.getMcNo());
            jsonObject.put("rule_index", tmMcMoneyOffRuleInfo.getRuleIndex());
            jsonObject.put("criteria", tmMcMoneyOffRuleInfo.getCriteria());
            jsonObject.put("discount_floor", tmMcMoneyOffRuleInfo.getDiscountFloor());
            jsonObject.put("discount_celling", tmMcMoneyOffRuleInfo.getDiscountCelling());
            jsonObject.put("discount_quantity", tmMcMoneyOffRuleInfo.getDiscountQuantity());
            jsonObject.put("discount_limit", tmMcMoneyOffRuleInfo.getDiscountLimit());
            jsonObject.put("budget", tmMcMoneyOffRuleInfo.getBudget());
            jsonObject.put("budget_day_limit", tmMcMoneyOffRuleInfo.getBudgetDayLimit());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用营销活动机构信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcOrgInfo 营销活动机构信息表
     * @param rgLogger    平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 22:11
     */
    public static String packMcOrgInfoTmpBizData1(TMMcOrgInfo tmMcOrgInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("inst_id", tmMcOrgInfo.getInstId());
            jsonObject.put("mc_no", tmMcOrgInfo.getMcNo());
            jsonObject.put("org_id", tmMcOrgInfo.getOrgId());
            jsonObject.put("org_hierarchy", tmMcOrgInfo.getOrgHierarchy());
            jsonObject.put("org_name", tmMcOrgInfo.getOrgName());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用代理商营销活动信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcAgentProfitSharingRuleInfo 营销活动机构信息表
     * @param rgLogger                       平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 22:11
     */
    public static String packApsRuleInfoTmpBizData1(TMMcAgentProfitSharingRuleInfo tmMcAgentProfitSharingRuleInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("inst_id", tmMcAgentProfitSharingRuleInfo.getInstId());
            jsonObject.put("mc_no", tmMcAgentProfitSharingRuleInfo.getMcNo());
            jsonObject.put("rule_index", tmMcAgentProfitSharingRuleInfo.getRuleIndex());
            jsonObject.put("criteria_floor", tmMcAgentProfitSharingRuleInfo.getCriteriaFloor());
            jsonObject.put("criteria_celling", tmMcAgentProfitSharingRuleInfo.getCriteriaCelling());
            jsonObject.put("discount_type", tmMcAgentProfitSharingRuleInfo.getDiscountType());
            jsonObject.put("discount", tmMcAgentProfitSharingRuleInfo.getDiscount());
            jsonObject.put("opr_id", tmMcAgentProfitSharingRuleInfo.getOprId());
            jsonObject.put("create_time", tmMcAgentProfitSharingRuleInfo.getCreateTime());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用营销活动商户信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcMchntInfo
     * @param rgLogger      平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 22:28
     */
    public static String packMcMchntInfoTmpBizData1(TMMcMchntInfo tmMcMchntInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("inst_id", tmMcMchntInfo.getInstId());
            jsonObject.put("mc_no", tmMcMchntInfo.getMcNo());
            jsonObject.put("mchnt_no", tmMcMchntInfo.getMchntNo());
            jsonObject.put("mchnt_type", tmMcMchntInfo.getMchntType());
            jsonObject.put("mchnt_name", tmMcMchntInfo.getMchntName());
            jsonObject.put("new_mchnt_flag", tmMcMchntInfo.getNewMchntFlag());
            jsonObject.put("exit_flag", tmMcMchntInfo.getExitFlag());
            jsonObject.put("qualified_date", tmMcMchntInfo.getQualifiedDate());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用营销活动用户信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcUserInfo 营销活动用户信息表
     * @param rgLogger     平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 22:28
     */
    public static String packMcUserInfoTmpBizData1(TMMcUserInfo tmMcUserInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("inst_id", tmMcUserInfo.getInstId());
            jsonObject.put("mc_no", tmMcUserInfo.getMcNo());
            jsonObject.put("acct_no", tmMcUserInfo.getAcctNo());
            jsonObject.put("acct_type", tmMcUserInfo.getAcctType());
            jsonObject.put("acct_flag", tmMcUserInfo.getAcctFlag());
            jsonObject.put("member_id", tmMcUserInfo.getMemberId());
            jsonObject.put("day_restriction", tmMcUserInfo.getDayRestriction());
            jsonObject.put("week_restriction", tmMcUserInfo.getWeekRestriction());
            jsonObject.put("month_restriction", tmMcUserInfo.getMonthRestriction());
            jsonObject.put("querter_restriction", tmMcUserInfo.getQuerterRestriction());
            jsonObject.put("year_restriction", tmMcUserInfo.getYearRestriction());
            jsonObject.put("restriction", tmMcUserInfo.getRestriction());


            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用营销活动时间信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcTimeInfo 营销活动时间信息表
     * @param rgLogger     平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 22:45
     */
    public static String packMcTimeInfoTmpBizData1(TMMcTimeInfo tmMcTimeInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("inst_id", tmMcTimeInfo.getInstId());
            jsonObject.put("mc_no", tmMcTimeInfo.getMcNo());
            jsonObject.put("rule_index", tmMcTimeInfo.getRuleIndex());
            jsonObject.put("flag_monday", tmMcTimeInfo.getFlagMonday());
            jsonObject.put("flag_tuesday", tmMcTimeInfo.getFlagTuesday());
            jsonObject.put("flag_wednesday", tmMcTimeInfo.getFlagWednesday());
            jsonObject.put("flag_thursday", tmMcTimeInfo.getFlagThursday());
            jsonObject.put("flag_friday", tmMcTimeInfo.getFlagFriday());
            jsonObject.put("flag_saturday", tmMcTimeInfo.getFlagSaturday());
            jsonObject.put("flag_sunday", tmMcTimeInfo.getFlagSunday());
            jsonObject.put("start_time", tmMcTimeInfo.getStartTime());
            jsonObject.put("end_time", tmMcTimeInfo.getEndTime());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用营销活动产品信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcProductInfo 营销活动产品信息表
     * @param rgLogger        平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 22:46
     */
    public static String packMcProdInfoTmpBizData1(TMMcProductInfo tmMcProductInfo, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("inst_id", tmMcProductInfo.getInstId());
            jsonObject.put("mc_no", tmMcProductInfo.getMcNo());
            jsonObject.put("biz_prod_code", tmMcProductInfo.getBizProdCode());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析代理商返现类营销活动基本信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpApsMcInfo 代理商返现类营销活动基本信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @since 2020/6/16 22:16
     */
    public static JsonTmpApsMcInfo parseApsMcInfoTmpBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpApsMcInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析代理商返现类营销活动信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析收银员返现类营销活动基本信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpCcbMcInfo 收银员返现类营销活动基本信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @since 2020/6/16 22:16
     */
    public static JsonTmpCcbMcInfo parseCcbMcInfoTmpBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpCcbMcInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析收银员返现类营销活动信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析卡券类营销活动基本信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpCpMcInfo 卡券类营销活动基本信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/25 21:50
     */
    public static JsonTmpCpMcInfo parseCpMcInfoTmpBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpCpMcInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析卡券类营销活动信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析商户手续费优惠类营销活动基本信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpMfdMcInfo 商户手续费优惠类营销活动基本信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/25 21:50
     */
    public static JsonTmpMfdMcInfo parseMfdMcInfoTmpBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpMfdMcInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析商户手续费优惠类营销活动信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析营销活动基本信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpMcInfo 减免类营销活动基本信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/25 21:50
     */
    public static JsonTmpMoMcInfo parseMoMcInfoTmpBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpMoMcInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析减免类营销活动信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析营销活动机构信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpMcOrgInfo 营销活动机构信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 20:05
     */
    public static JsonTmpMcOrgInfo parseTmpMcOrgInfoBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpMcOrgInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析营销活动机构信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析营销活动商户信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpMcMchntInfo 营销活动商户信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 20:12
     */
    public static JsonTmpMcMchntInfo parseTmpMcMchntInfoBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpMcMchntInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析营销活动商户信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析营销活动用户信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpMcUserInfo 营销活动用户信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 20:18
     */
    public static JsonTmpMcUserInfo parseTmpMcUserInfoBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpMcUserInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析营销活动用户信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析营销活动时间信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpMcUserInfo 营销活动时间信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 20:18
     */
    public static JsonTmpMcTimeInfo parseTmpMcTimeInfoBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpMcTimeInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析营销活动时间信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析营销活动产品信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpMcUserInfo 营销活动时间信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 20:18
     */
    public static JsonTmpMcProdInfo parseTmpMcProdInfoBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpMcProdInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析营销活动时间信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析减免类营销活动规则信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpCpMcRuleInfo 卡券类营销活动规则信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 20:18
     */
    public static JsonTmpCpMcRuleInfo parseTmpCpMcRuleInfoBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpCpMcRuleInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析营销活动时间信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析减免类营销活动规则信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpMfdMcRuleInfo 商户手续费优惠类营销活动规则信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 20:18
     */
    public static JsonTmpMfdMcRuleInfo parseTmpMfdMcRuleInfoBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpMfdMcRuleInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析营销活动时间信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析代理商分润类营销活动规则信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmApsMcRuleInfo 营销活动时间信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 20:18
     */
    public static JsonTmApsMcRuleInfo parseTmpApsMcRuleInfoBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmApsMcRuleInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析营销活动规则信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析减免类营销活动规则信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpMcUserInfo 营销活动时间信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 20:18
     */
    public static JsonTmpMoMcRuleInfo parseTmpMoMcRuleInfoBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpMoMcRuleInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析营销活动时间信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析代理商分润类营销活动详情信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpApsMcInfo 营销活动时间信息临时表正式表数据转换类`
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 20:18
     */
    public static JsonTmpApsMcInfo parApsMcInfoTmpBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpApsMcInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析营销活动时间信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析代理商分润类营销活动详情信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpApsMcInfo 营销活动时间信息临时表正式表数据转换类`
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 20:18
     */
    public static JsonTmpCcbMcInfo parCcbMcInfoTmpBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpCcbMcInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析营销活动时间信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析营销活动基本信息
     * 各类营销活动通用
     *
     * @param rgLogger     平台日志
     * @param tmPlatBizTmp 业务数据临时表
     * @return java.lang.Object 返回对象
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/26 03:41
     */
    public static Object parseMcInfoTmpBizData1(RgLogger rgLogger, TMPlatBizTmp tmPlatBizTmp, String tableName) throws Exception {

        try {

            Class<?> tClass;

            switch (TableNameEnum.getByValue(tableName)) {
                case T_M_MC_APS_INFO:
                    /* 代理商返现类营销活动 */
                    tClass = JsonTmpApsMcInfo.class;
                    break;
                case T_M_MC_CCB_INFO:
                    /* 收银员返现类营销活动 */
                    tClass = JsonTmpCcbMcInfo.class;
                    break;
                case T_M_MC_CP_INFO:
                    /* 卡券类营销活动 */
                    tClass = JsonTmpCpMcInfo.class;
                    break;
                case T_M_MC_MFD_INFO:
                    /* 商户手续费优惠类营销活动 */
                    tClass = JsonTmpMfdMcInfo.class;
                    break;
                case T_M_MC_MO_INFO:
                    /* 减免类营销活动 */
                    tClass = JsonTmpMoMcInfo.class;
                    break;
                default:
                    rgLogger.error("不支持的营销活动类型! TABLE_NAME=<{}>", tableName);
                    return null;
            }

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), tClass);

        } catch (Exception e) {
            rgLogger.error("解析减免类营销活动信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析营销活动商户规则信息
     *
     * @param rgLogger         平台日志
     * @param tmPlatBizTmpList 业务数据临时表
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcMchntInfo> 营销活动商户信息表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/25 23:00
     */
    public static List<TMMcMchntInfo> parseMcMchntInfoTmpBizData1(RgLogger rgLogger, List<TMPlatBizTmp> tmPlatBizTmpList) throws Exception {

        try {

            List<TMMcMchntInfo> tmMcMchntInfoList = new ArrayList<>();

            for (TMPlatBizTmp tmPlatBizTmp : tmPlatBizTmpList) {

                JsonTmpMcMchntInfo jsonTmpMcMchntInfo = JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpMcMchntInfo.class);
                TMMcMchntInfo tmMcMchntInfo = new TMMcMchntInfo();

                tmMcMchntInfo.setInstId(jsonTmpMcMchntInfo.getInstId());
                tmMcMchntInfo.setMcNo(jsonTmpMcMchntInfo.getMcNo());
                tmMcMchntInfo.setMchntNo(jsonTmpMcMchntInfo.getMchntNo());
                tmMcMchntInfo.setMchntType(jsonTmpMcMchntInfo.getMchntType());
                tmMcMchntInfo.setMchntName(jsonTmpMcMchntInfo.getMchntName());
                tmMcMchntInfo.setNewMchntFlag(jsonTmpMcMchntInfo.getNewMchntFlag());
                tmMcMchntInfo.setExitFlag(jsonTmpMcMchntInfo.getExitFlag());
                tmMcMchntInfo.setQualifiedDate(jsonTmpMcMchntInfo.getQualifiedDate());

                tmMcMchntInfoList.add(tmMcMchntInfo);
            }

            return tmMcMchntInfoList;

        } catch (Exception e) {
            rgLogger.error("解析减免类营销活动商户信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 使用(合并)支付使用商户手续费优惠类营销活动交易信息实体类拼接订单明细表ORDER_REMARK字段内容
     *
     * @param mcMchntFeeDiscountTxnData (合并)支付使用商户手续费优惠类营销活动交易信息
     * @param rgLogger                  平台日志
     * @return java.lang.String 拼接字符串
     * @throws BizException 异常信息
     * @author Jinan Liu
     * @date 2020/6/11 01:08
     */
    public static String packMfdMcOrderDetailOrderRemark(McMchntFeeDiscountTxnData mcMchntFeeDiscountTxnData, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();

//            jsonObject.put("mchntNo", mcMchntFeeDiscountTxnData.getMchntNo());
            jsonObject.put("orderAmt", mcMchntFeeDiscountTxnData.getOrderAmt());
            jsonObject.put("feeInputMode", mcMchntFeeDiscountTxnData.getFeeInputMode());
            jsonObject.put("mchntFeeReceivable", mcMchntFeeDiscountTxnData.getMchntFeeReceivable());
            jsonObject.put("mchntFeeReceivableRate", mcMchntFeeDiscountTxnData.getMchntFeeReceivableRate());
            jsonObject.put("discountType", mcMchntFeeDiscountTxnData.getDiscountType());
            jsonObject.put("discount", mcMchntFeeDiscountTxnData.getDiscount());
//            jsonObject.put("mchntFeeDiscount", mcMchntFeeDiscountTxnData.getMchntFeeDiscount());
//            jsonObject.put("mchntFeeActual", mcMchntFeeDiscountTxnData.getMchntFeeActual());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("转换商户手续费优惠营销活动登记订单明细表订单预留信息失败!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用(合并)支付使用卡券类交易信息实体类拼接订单明细表ORDER_REMARK字段内容
     *
     * @param mcCouponTxnData (合并)支付使用卡券类交易信息
     * @param rgLogger        平台日志
     * @return java.lang.String 拼接字符串
     * @throws BizException 异常信息
     * @author Jinan Liu
     * @date 2020/7/22 10:05
     */
    public static String packCpMcOrderDetailOrderRemark(McCouponTxnData mcCouponTxnData, RgLogger rgLogger) throws BizException {

        try {

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("couponNo", mcCouponTxnData.getCouponNo());

            return jsonObject.toJSONString();

        } catch (Exception e) {
            rgLogger.error("转换商户手续费优惠营销活动登记订单明细表订单预留信息失败!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 解析商户手续费优惠营销活动订单明细表原交易信息
     *
     * @param orderRemark 订单明细表ORDER_REMARK字段
     * @param rgLogger    平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonMfdMcOrderRemark 商户手续费优惠营销活动订单明细表原交易信息
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/6/11 01:13
     */
    public static JsonMfdMcOrderRemark parseMfdMcOrderDetailOrderRemark(String orderRemark, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(orderRemark, JsonMfdMcOrderRemark.class);

        } catch (Exception e) {
            rgLogger.error("解析商户手续费优惠营销活动订单明细表ORDER_REMARK字段数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }

    /**
     * 使用收银员返现营销活动信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcCashierCashbackInfo 收银员返现类营销活动信息表
     * @param rgLogger                平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/25 21:51
     */
    public static String packMcCashierCashbackInfoTmpBizData1(TMMcCashierCashbackInfo tmMcCashierCashbackInfo, RgLogger rgLogger) throws BizException {
        try {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("inst_id", tmMcCashierCashbackInfo.getInstId());
            jsonObject.put("mc_no", tmMcCashierCashbackInfo.getMcNo());
            jsonObject.put("mc_name", tmMcCashierCashbackInfo.getMcName());
            jsonObject.put("mc_type", tmMcCashierCashbackInfo.getMcType());
            jsonObject.put("mc_status", tmMcCashierCashbackInfo.getMcStatus());
            jsonObject.put("mc_start_date", tmMcCashierCashbackInfo.getMcStartDate());
            jsonObject.put("mc_end_date", tmMcCashierCashbackInfo.getMcEndDate());
            jsonObject.put("mc_actual_end_date", tmMcCashierCashbackInfo.getMcActualEndDate());
            jsonObject.put("discount_transfer_mode", tmMcCashierCashbackInfo.getDiscountTransferMode());
            jsonObject.put("budget", tmMcCashierCashbackInfo.getBudget());
            jsonObject.put("criteria_flag", tmMcCashierCashbackInfo.getCriteriaFlag());
            jsonObject.put("criteria_limit", tmMcCashierCashbackInfo.getCriteriaLimit());
            jsonObject.put("stat_period", tmMcCashierCashbackInfo.getStatPeriod());
            jsonObject.put("criteria_amount", tmMcCashierCashbackInfo.getCriteriaAmount());
            jsonObject.put("criteria_quantity", tmMcCashierCashbackInfo.getCriteriaQuantity());
            jsonObject.put("termination_flag_person", tmMcCashierCashbackInfo.getTerminationFlagPerson());
            jsonObject.put("quantity_limit_p", tmMcCashierCashbackInfo.getQuantityLimitP());
            jsonObject.put("amount_limit_p", tmMcCashierCashbackInfo.getAmountLimitP());
            jsonObject.put("cashback_limit_p", tmMcCashierCashbackInfo.getCashbackLimitP());
            jsonObject.put("termination_flag_mc", tmMcCashierCashbackInfo.getTerminationFlagMc());
            jsonObject.put("quantity_limit_mc", tmMcCashierCashbackInfo.getQuantityLimitMc());
            jsonObject.put("amount_limit_mc", tmMcCashierCashbackInfo.getAmountLimitMc());
            jsonObject.put("cashback_limit_mc", tmMcCashierCashbackInfo.getCashbackLimitMc());
            jsonObject.put("cashback_method", tmMcCashierCashbackInfo.getCashbackMethod());
            jsonObject.put("audit_status", tmMcCashierCashbackInfo.getAuditStatus());
            jsonObject.put("crt_org_id", tmMcCashierCashbackInfo.getCrtOrgId());
            jsonObject.put("point_rule_data", tmMcCashierCashbackInfo.getPointRuleData());

            return jsonObject.toJSONString();
        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 使用收银员返现营销活动规则信息表实体类拼接临时表BizData1字段内容
     *
     * @param tmMcCashierCashbackRuleInfo 收银员返现营销活动规则表
     * @param rgLogger                    平台日志
     * @return java.lang.String JSON字符串
     * @throws Exception
     * @author Jinan Liu
     * @date 2020/5/28 22:39
     */
    public static String packCashierCashbackRuleInfoTmpBizData1(TMMcCashierCashbackRuleInfo tmMcCashierCashbackRuleInfo, RgLogger rgLogger) throws BizException {
        try {
            JSONObject jsonObject = new JSONObject();

            jsonObject.put("inst_id", tmMcCashierCashbackRuleInfo.getInstId());
            jsonObject.put("mc_no", tmMcCashierCashbackRuleInfo.getMcNo());
            jsonObject.put("rule_index", tmMcCashierCashbackRuleInfo.getRuleIndex());
            jsonObject.put("criteria_floor", tmMcCashierCashbackRuleInfo.getCriteriaFloor());
            jsonObject.put("criteria_celling", tmMcCashierCashbackRuleInfo.getCriteriaCelling());
            jsonObject.put("cashback_ratio", tmMcCashierCashbackRuleInfo.getCashbackRatio());
            jsonObject.put("discount_type", tmMcCashierCashbackRuleInfo.getDiscountType());
            jsonObject.put("discount", tmMcCashierCashbackRuleInfo.getDiscount());

            return jsonObject.toJSONString();
        } catch (Exception e) {
            rgLogger.error("公共业务数据不可为空!");
            throw new BizException(RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespCode(), RespCodeEnum.MSG_VALID_CHECK_ERROR.getRespDesc());
        }
    }

    /**
     * 从JSON字符串解析收银员返现活动规则信息
     *
     * @param tmPlatBizTmp 业务数据临时表
     * @param rgLogger     平台日志
     * @return cc.rengu.igas.momp.common.model.bean.JsonTmpCcbMcRuleInfo 收银员返现活动时间信息临时表正式表数据转换类
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 20:18
     */
    public static JsonTmpCcbMcRuleInfo parseTmpCcbMcRuleInfoBizData1(TMPlatBizTmp tmPlatBizTmp, RgLogger rgLogger) throws Exception {

        try {

            return JSON.parseObject(tmPlatBizTmp.getBizData1(), JsonTmpCcbMcRuleInfo.class);

        } catch (Exception e) {
            rgLogger.error("解析收银员返现活动时间信息临时表数据失败!");
            throw new BizException(RespCodeEnum.SYSTEM_ERROR.getRespCode(), RespCodeEnum.SYSTEM_ERROR.getRespDesc());
        }
    }
}
